home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 August / August CD.bin / Shareware / Education / numericalmethods Folder / chap_4 / zsqrt4.m < prev    next >
Encoding:
Text File  |  1994-06-05  |  1.3 KB  |  53 lines  |  [MATF/MATL]

  1. function [fun,dfun,ifun,x0,m,C,Ax] = zsqrt4
  2. % Taylor series coefficient lists for several functions.
  3. % Pm(x) = c(1) + c(2)x + c(2)x^2 + ... + c(m+1)x^m
  4. % fun  is the function, output.
  5. % dfun is the derivative, output.
  6. % ifun is the integral, output.
  7. % x0 is the point of expansion, output.
  8. % m  is the degree of the polynomial, output.
  9. % C  is the coefficient list, output.
  10. % Ax contains three asis vectors plotting, output.
  11. x0 = 0; 
  12. m = 25;
  13. a = -3.9;
  14. b = 4.0;
  15. ymin = 0;
  16. ymax = 3;
  17. ymin1 = 0;
  18. ymax1 = 1.6;
  19. ymin2 = -6;
  20. ymax2 = 10;
  21. Ax(1,:) = [a b ymin ymax];
  22. Ax(2,:) = [a b ymin1 ymax1];
  23. Ax(3,:) = [a b ymin2 ymax2];
  24. fun = 'sqrt(4+x)';
  25. dfun = '(2.*sqrt(4+x)).^(-1)';
  26. ifun = '(8/3+2.*x/3).*sqrt(4+x)-16/3';
  27. C = [322476036831/79228162514264337593543950336,
  28. -171529806825/9903520314283042199192993792,
  29. 11435320455/154742504910672534362390528,
  30. -6116566755/19342813113834066795298816,
  31. 1641030105/1208925819614629174706176,
  32. -883631595/151115727451828646838272,
  33. 119409675/4722366482869645213696,
  34. -64822395/590295810358705651712,
  35. 17678835/36893488147419103232,
  36. -9694845/4611686018427387904,
  37. 334305/36028797018963968,
  38. -185725/4503599627370496,
  39. 52003/281474976710656,
  40. -29393/35184372088832,
  41. 4199/1099511627776,
  42. -2431/137438953472,
  43. 715/8589934592,
  44. -429/1073741824,
  45. 33/16777216,
  46. -21/2097152,
  47. 7/131072,
  48. -5/16384,
  49. 1/512,
  50. -1/64,
  51. 1/4,
  52. 2];
  53.